#include "queue.h"
#include <stdio.h>

#define QUEUE_CAPACITY 10

typedef struct {
    uint8_t id;
    uint16_t value;
} MyData;

uint8_t queue_buffer[QUEUE_CAPACITY * sizeof(MyData)];
Queue_HandleTypeDef myQueue;

void test_queue()
{
    queue_init(&myQueue, queue_buffer, QUEUE_CAPACITY, sizeof(MyData));

    MyData data1 = {1, 100};
    MyData data2 = {2, 200};

    queue_push(&myQueue, &data1);
    queue_push(&myQueue, &data2);

    MyData temp;
    while (!queue_is_empty(&myQueue)) {
        queue_pop(&myQueue, &temp);
        printf("Dequeued: id=%d, value=%d\n", temp.id, temp.value);
    }
}
